<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        let arr = [18, 'zhangsan'];

        // let age = arr[0];
        // let username = arr[1];

        /* 
            解构数组：
                根据顺序（下标）
        */
        //    age 获取 第0个元素的值
        //    username 获取 第1个元素的值
        let [a, username, aaa] = arr;
        console.log(a, username);
        console.log(aaa);//undefined






    </script>

</body>

</html>